Results 1 to 5 of 5

Thread: Damage Event Help

  1. #1

    Default Damage Event Help

    Code:
    damage local.target local.inflictor local.damage local.position local.direction local.normal local.knockback local.damageflags local.meansofdeath local.location local.entity:
      if(local.target != NULL && local.target != NIL && local.inflictor != NULL && local.inflictor != NIL && local.entity.classname == "Player" && local.inflictor.classname == "Player" )
    	{	
         println "In the damage loop"
         // If damage is greater than or equal to 50, add a half a point	
    	   if(local.damage >= 40 && isAlive($player[local.target.entnum])){
            println "target is alive"
            if(level.extraPointStorage[local.inflictor.entnum] == NIL || level.extraPointStorage[local.inflictor.entnum] == NULL || level.extraPointStorage[local.inflictor.entnum] == 0){ 
              level.extraPointStorage[local.inflictor.entnum] = 0.5
            }else{
              level.extraPointStorage[local.inflictor.entnum] += 0.5
            }
            println level.extraPointStorage[local.inflictor.entnum]
            if(level.extraPointStorage[local.inflictor.entnum] == 1){
              local.inflictor addkills 1
              level.extraPointStorage[local.inflictor.entnum] = 0;
              thread notifier local.inflictor
            }
         }
    	}
    end
    Code:
     if(local.damage >= 40 && isAlive($player[local.target.entnum])){ (hitpoints/hitpoints.scr, 28)
    if(local.damage >= 40 && isAlive($player^
    
    ^~^~^ Script Error: array index 1022 out of range
    Any idea what that's about? I was assuming local.target was the player who took damage?
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  2. #2

    Default

    Got it. Use local.entity... not local.target
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  3. #3
    Developer
    Join Date
    Jun 2010
    Location
    Hungary
    Posts
    291

    Default

    Local.target is the projectile itself when you damage something with Bazooka or grenade. I don't think if it defines something when you shooting only with bullet weapons.

  4. #4
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    $player is just an array of player entities, not the array of all entities (which is the array where entnum/clientnum corresponds with the index).
    Use the new getentity command to query that array instead.

    In this case, you wouldn't be needing it as local.entity is the entity being shot at. If it is a player, it will be the player entity you need.
    Beware that the damage event is raised for all entities so the local.entity (or local.inflictor etc.. for that matter) may not necessarily be players.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  5. #5
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,245

    Default

    Exactly, it can be a breakable window for example, which has it's own health etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •